home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / manage / snmp / kip / ab.h next >
Encoding:
C/C++ Source or Header  |  1989-01-17  |  4.3 KB  |  231 lines

  1. /*
  2.  *  AppleTalk definitions.
  3.  *
  4.  *  Copyright (c) 1984, Apple Computer Inc.
  5.  *  Gene Tyacke, Alan Oppenheimer, G. Sidhu, Rich Andrews.
  6.  *
  7.  *  C language version (c) 1984, Stanford Univ. SUMEX project.
  8.  *  May be used but not sold without permission.
  9.  *
  10.  *  (c) 1986, Kinetics, Inc.
  11.  *  May be used but not sold without permission.
  12.  *
  13.  *  $Header: ab.h,v 4.1 88/11/01 19:47:39 sw0l Exp $
  14.  */
  15.  
  16. /*
  17.  * history
  18.  * 08/24/84    GRT    Created.
  19.  * 10/23/84    GRT    
  20.  * 12/01/84    Croft    Created C version;  added packet headers, *Params.
  21.  */
  22.  
  23.  
  24. struct LAP {            /* LAP */
  25.     u_char    dst;
  26.     u_char    src;
  27.     u_char    type;
  28. };
  29.  
  30. typedef struct LAP LAPAdrBlock;    /* LAPAdrBlock */
  31. #define    dstNodeID    dst
  32. #define    srcNodeID    src
  33. #define    lapProtType    type
  34.  
  35. /* LAP definitions */
  36. #define    lapDDPS        1    /* short DDP type */
  37. #define    lapShortDDP    1
  38. #define    lapDDP        2    /* DDP type */
  39. #define    lapSize        3    /* size of lap header */
  40.  
  41. typedef struct {        /* AddrBlock */
  42.     u_short    net;
  43.     u_char    node;
  44.     u_char    skt;
  45. } AddrBlock;
  46.  
  47.  
  48. struct DDP {            /* DDP */
  49.     u_short    length;
  50.     u_short    checksum;
  51.     u_short    dstNet;
  52.     u_short    srcNet;
  53.     u_char    dstNode;
  54.     u_char    srcNode;
  55.     u_char    dstSkt;
  56.     u_char    srcSkt;
  57.     u_char    type;
  58. };
  59.  
  60. struct DDPS {            /* DDPS */
  61.     u_short    length;
  62.     u_char    dstSkt;
  63.     u_char    srcSkt;
  64.     u_char    type;
  65. };
  66.  
  67. /* DDP definitions */
  68. #define    ddpMaxWKS    0x7F
  69. #define    ddpMaxData    586
  70. #define    ddpLengthMask    0x3FF
  71. #define    ddpHopShift    10
  72. #define    ddpSize        13    /* size of DDP header */
  73. #define    ddpSSize    5
  74. #define    ddpWKS        128    /* boundary of DDP well known sockets */
  75. #define    ddpRTMP        1    /* RTMP type */
  76. #define    ddpNBP        2    /* NBP type */
  77. #define    ddpATP        3    /* ATP type */
  78. #define ddpECHO         4    /* ECHO type */
  79. #define    ddpRTMPR    5    /* RTMP 'request' */
  80. #define    ddpZIP        6    /* ZIP type */
  81. #define ddpADSP        7    /* ADSP packet */
  82. #define    ddpIP        22    /* IP type */
  83. #define    ddpARP        23    /* ARP type */
  84.  
  85. typedef struct {        /* WDS (write data structure) */
  86.     u_short    size;
  87.     u_char    *ptr;
  88. } WDS;
  89.  
  90. #ifdef    MAC
  91.  
  92. struct DDPParam {        /* DDP CSParam control / status calls */
  93.     u_char    sktNum;
  94.     u_char    checksum;
  95.     Ptr    address;    /* socket listener or WDS */
  96. };
  97.  
  98. /* DDP CSCodes */
  99. #define    ddpWrite    246
  100. #define    ddpCloseSkt    247
  101. #define    ddpOpenSkt    248
  102.  
  103. #endif    MAC
  104.  
  105.  
  106. struct ZIP {            /* ZIP */
  107.     u_char    command;
  108.     u_char    count;
  109. };
  110. #define    zipSkt        6    /* number of ZIP socket */
  111. #define    zipQuery    1
  112. #define    zipReply    2
  113. #define    zipTakedown    3
  114. #define    zipBringup    4
  115.  
  116.  
  117. struct RTMP {            /* RTMP */
  118.     u_short    net;
  119.     u_char    idLen;
  120.     u_char    id;        /* start of ID field */
  121. };
  122.  
  123. struct RTMPtuple {
  124.     u_short    net;
  125.     u_char    hops;
  126. };
  127. #define    rtmpSkt    1        /* number of RTMP socket */
  128. #define    rtmpSize    4    /* minimum size */
  129. #define    rtmpTupleSize    3
  130. #define    RTMPTuple    RTMPtuple
  131.  
  132.  
  133. typedef struct {        /* NBPTuple */
  134.     AddrBlock addr;
  135.     u_char    enume;
  136.     u_char    name[3];    /* minimum length */
  137. } NBPTuple;
  138.  
  139. struct NBP {            /* NBP */
  140.     u_char    control;
  141.     u_char    id;
  142.     NBPTuple tuple;
  143. };
  144.  
  145. typedef struct {        /* Entity, unpacked */
  146.     u_char    obj[34];
  147.     u_char    type[34];
  148.     u_char    zone[34];
  149. } Entity;
  150.  
  151. #define    nbpControlMask    0xF0
  152. #define    nbpCountMask    0x0F
  153. #define    nbpBrRq        0x10
  154. #define    nbpLkUp        0x20
  155. #define    nbpLkUpReply    0x30
  156. #define    nbpNIS        2
  157. #define    nbpMinSize    (sizeof (struct NBP) -3)
  158. #define    nbpEquals    '='
  159. #define    nbpStar        '*'
  160.     
  161.  
  162. struct ATP {            /* ATP */
  163.     u_char    control;
  164.     u_char    bitmap;
  165.     u_short    transID;
  166.     long    userData;
  167. };
  168. #define    atpReqCode    0x40
  169. #define    atpRspCode    0x80
  170. #define    atpRelCode    0xC0
  171. #define    atpXO        0x20
  172. #define    atpEOM        0x10
  173. #define    atpSTS        0x08
  174. #define    atpFlagMask    0x3F
  175. #define    atpControlMask    0xF8
  176. #define    atpMaxNum    8
  177.  
  178. #ifdef    MAC
  179. struct ATPParam {        /* CSParam for ATP request */
  180.     u_char    socket;
  181.     u_char    flags;
  182.     AddrBlock address;
  183.     u_short    size;
  184.     Ptr    buffer;
  185.     BDS    bds;
  186.     u_char    atpBitmap;
  187.     u_char    atpTimeout;
  188.     u_short    atpTID;
  189. };
  190. #define    atpNBuffs    atpBitmap
  191. #define    atpBDSSize    atpTimeout
  192. #define    atpRetryCnt    atpTID
  193. #define    atpNResps    (atpTID>>8)
  194. /* ATP CSCodes */
  195. #define    atpRelRspCB    249
  196. #define    atpCloseSkt    250
  197. #define    atpAddResponse    251
  198. #define    atpSendResponse    252
  199. #define    atpGetRequest    253
  200. #define    atpOpenSkt    254
  201. #define    atpSendRequest    255
  202. #define    atpRelTCB    256
  203. #endif    MAC
  204.  
  205.  
  206. typedef struct {        /* RetransType */
  207.     u_char    retransInterval;
  208.     u_char    retransCount;
  209. } RetransType;
  210.  
  211. typedef struct {        /* BDSElement */
  212.     u_short    buffSize;
  213.     u_char    *buffPtr;
  214.     u_short    dataSize;
  215.     long    userBytes;
  216. } BDSElement;
  217.  
  218. typedef struct {        /* BDSType */
  219.     BDSElement a[8];
  220. } BDSType;
  221.  
  222. /*
  223.  * Echo protocol definitions
  224.  *
  225. */
  226. #define echoRequest 1        /* echo Request cmd */
  227. #define echoReply 2        /* echo reply cmd */
  228. #define echoSkt 4        /* echo socket */
  229.  
  230.  
  231.